The invention relates to managing memory pages.
It is useful to use a volatile memory store (e.g., random access memory (RAM)) to work with data that is also stored in a non-volatile memory store (e.g., one or more disk drives). For example, the volatile memory store typically has faster access and read times than the non-volatile memory store. The address spaces of the volatile memory store and of the non-volatile memory store can be organized into pages that span a predetermined number of contiguous address locations. A computer system uses a paging technique to allocate memory pages from the volatile memory store to be used, for example, by programs or data structures. The non-volatile memory store is typically much larger than the volatile memory store. A virtual memory scheme can be used to allow pages in the volatile memory store that are not in use (e.g., not currently being written to or read from) to be written to the non-volatile memory store and then read back from the non-volatile memory store again later when needed. Thus, pages in the volatile memory store are “recycled” for use by various programs and/or data structures. To reduce the overhead associated with moving pages back and forth, some techniques recycle pages according to a least-recently used (LRU) approach. In the LRU approach, if a page that has been written to the non-volatile memory store is to be moved to the volatile memory store and there are no more free pages in the volatile memory store, then a page selected to be recycled (or “swapped” or “paged out”) from the volatile memory store to the non-volatile memory store is the page that has been least-recently used (e.g., least-recently read from or written to).